MODIFYING help.c

Your final step in adapting Dialog Help to the requirements of your own application is to make some modifications in three areas of the source code file help.c.

#defines

There is a block of #defines at the top of  help.c which relate to the IDs of the 'TEXT'/'styl' resources, and of the starting (base) IDs of the 'PICT' resources, relevant to the version of Help Dialog you are now viewing:

   #define
rTextIntroduction      128
   #define rTextCreatingText      129
   #define rTextModifyHelp        130
   #define rTextAboutCricket      131

   #define
rPictIntroductionBase

128
   #define
rPictCreatingTextBase

129
   #define rPictAboutCricketBase

131

These need to be changed to reflect the requirements of your own version of Help Dialog.

Initial 'TEXT'/'styl' ID and Base 'PICT' ID

The text and pictures displayed when the dialog opens should be those relating to the first item in the popup menu.  This is achieved by the assignment of values to the global variables  gTextResourceID and gPictResourceBaseID about a third of the way into the function doHelp:

   gTextResourceID = rTextIntroduction;
   gPictResourceBaseID = rPictIntroductionBase;

Change the assignment to reflect the requirements of your own version of Help Dialog.

Response to Popup Menu Choices 

Popup menu choices are detected and handled within the ModalDialog loop in the function doHelp.  When the menu item number is retrieved, this switch is entered:

   switch(menuItem)
   
     case 1:
       gTextResourceID     = rTextIntroduction;
       gPictResourceBaseID = rPictIntroductionBase;
       break;

     case 2:
       gTextResourceID     = rTextCreatingText;
       gPictResourceBaseID = rPictCreatingTextBase;
       break;

     case 3:
       gTextResourceID     = rTextModifyHelp;
       break;

     case 5:
       gTextResourceID     = rTextAboutCricket;
       gPictResourceBaseID
= rPictAboutCricketBase;
       break;

Change the number of cases in this switch to reflect the number of menu items in your popup menu.  Also change the assignments so that the global variables   gTextResourceID and gPictResourceBaseID are assigned the correct 'TEXT' IDs and, where appropriate, the correct base 'PICT' ID.